package com.ruoyi.system.domain.request;

import com.fasterxml.jackson.annotation.JsonAlias;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * 描述 分页参数
 * 作者 ZhangPing
 * 创建时间 2023/8/21 11:59
 */
@NoArgsConstructor
@AllArgsConstructor
@Setter
public class PageParam extends BaseParam {
    @ApiModelProperty(value = "页数", example = "10")
    private Integer pageSize = 10;
    @ApiModelProperty(value = "页码", example = "1")
    @JsonAlias({"pageNum", "pageIndex"})
    private Integer pageNum = 1;

    public Integer getPageNum() {
        return pageNum == null ? 1 : pageNum;
    }

    public Integer getPageSize() {
        return pageSize == null ? 10 : pageSize;
    }
}
